package com.huike.clues.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huike.clues.domain.SysDictData;
import com.huike.clues.mapper.SysDictDataMapper;
import com.huike.clues.service.ISysDictDataService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.Collections;
import java.util.List;

/**
 * @version: 1.0
 * @Author: ljy
 * @description:
 * @date: 2025-08-11 21:02
 */
@Service
public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements ISysDictDataService {
    @Override
    public List<SysDictData> queryDictsByDictType(String dictType) {
        List<SysDictData> list = this.list(Wrappers.<SysDictData>lambdaQuery()
                .eq(SysDictData::getDictType, dictType));
        if (CollectionUtils.isEmpty(list)) {
            return Collections.emptyList();
        }
        return list;
    }
}
